package com.rw.mapper;

import com.rw.pojo.User;
import com.rw.utils.Page;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

/**
 * @author rabit
 */
public interface UserMapper {

    /**
     *
     * xx
     * @param uid
     * @return
     *
     * map数据结构来接收参数：
     *map.put("param1",uid)
     * map.put("param2",uname)
     * @param注解的意思是：map.put("uid",uid)
     * map.put("name",uname)
     */
    User selectByUid(@Param("uid") int uid,@Param("name") String uname);

    /**
     * 通过名字进行模糊查询
     * @param uname
     * @return
     */
    List<User> selectByLike(@Param("uname") String uname);

    List<User> selectByLike3(@Param("uname") String uname);
    List<User> selectByLike2(@Param("uname") String uname,@Param("uid") Integer uid);

    List<User> selectByPage(Page page);

    List<User> selectByPage2(RowBounds rowBounds);


    int saveData(User user);

    int saveData2(User user);

    List<User> selectData(User user);
    List<User> selectData2(User user);

    int update(User user);
    int update2(User user);

    int insertBatch(List<User> users);

    List<User> selectData3(List<Integer> ids);
}
